import loadMask from './loading'

// 自定义插件
const loading = {
  install (Vue) {
    const LoadingCase = Vue.extend(loadMask)
    // 创建组件实例
    const loadingComponent = new LoadingCase()
    document.body.appendChild(loadingComponent.$mount().$el)
    Vue.prototype.$ShowLoading = () => {
      loadingComponent.isShow = true
    }
    Vue.prototype.$hideLoading = () => {
      loadingComponent.isShow = false
    }
  }
}

export default loading
